import items from './items.js';
import Add from './components/AddEdit/Add.js';
import { tableBaseApi } from '@/services/api-common';
const setup = {
	name: 'DemoTable',
	isJiess: true,
	setup() {
		this.add(
			this.render({
				is: 'SuperTable',
				items,
				httpApi: tableBaseApi.list,
				httpKey: tableBaseApi.listKey,
				container(midder) {
					return {
						title: '左侧标题',
						extra: this.render({
							is: 'ActionButton',
							size: 'small',
							type: 'primary',
							text: '新增',
							onClick: () => {
								midder.open(Add, tableBaseApi.add, 'add', {
									// param: { wrapClassName: 'no-padding' }
								})
							}
						}).getNative()
					}
				},
				filter(midder) {
					return this.render({
						is: 'TableFilter',
						midder,
						// buttons: [{
						// 	text: '自定按钮',
						// 	onClick() {
						// 		console.log('哈哈哈')
						// 	}
						// }]
					})
				},
			})
		)
	}
};
export default setup;